#while 循环输出九九乘法表，四种格式
#九九乘法表，三角形左对齐，每一行都从1*i开始
i = 1
while i < 10:
    j = 1
    while j <= i:
        print("{}*{}={:<3}".format(j,i,i*j), end = " ")
        j += 1
    i += 1
    print("")

print('='*72)
#九九乘法表，倒三角形，左对齐，每一行都从1*i开始
i = 9

while i > 0:
    j = 1
    while j <= i:
        print("{}*{}={:<3}".format(j,i,i*j), end = " ")
        j += 1
    i -= 1
    print("")

#九九乘法表 三角形，右对齐
i = 1

while i < 10:
    j = i
    print(" "*8*(9-i),end = " ")#输出空白，保持每行左对齐
    while j > 0:
        print("{0:>2}*{1}={2:^2}".format(j,i,i*j),end =" ")
        j -= 1
    i += 1
    print("")

print('='*72)
#九九乘法表 倒三角形，右对齐
i = 9
while i > 0:
    j = i
    print(" "*8*(9-i),end = " ")#输出空白，保持每行左对齐
    while j > 0:
        print("{0:>2}*{1:}={2:^2}".format(j,i,i*j),end =" ")
        j -= 1
    i -= 1
    print("")

